﻿using System;

namespace ObjetoNegocio
{
    

    public  class Valor : IObject
    {
        public decimal Codigo { get; set; }
        public string Descricao{ get; set; }

        public override bool Equals(Object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (Valor)) return false;
            return Equals((Valor) obj);
        }

        public bool Equals(Valor obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            return obj.Codigo == Codigo && Equals(obj.Descricao, Descricao);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (Codigo.GetHashCode()*397) ^ (Descricao != null ? Descricao.GetHashCode() : 0);
            }
        }
    }



   
}
